#include <iostream>
#include <unistd.h>
#include <signal.h>

using namespace std;

int count = 0;

void handler(int signo)
{
  cout << "get a signo: " << signo << endl;
  cout << "count is " << count << endl;
  exit(1);
}

int main()
{
  alarm(1);   //一秒后给目标进程发送SIGALARM

  for(int i = 1; i < 32; i++)
  {
    signal(i, handler);
  }
  while(true){
    count++;
  }
  return 0;
}
